﻿// Copyright (c) Vitaly Kamiansky. All rights reserved. 
// See License.txt in the project root.

using System;

namespace Property.Objects
{
    public class InputProperty<T> : DecoupledProperty<T>, IInput<T>
    {
        protected InputProperty(IReloaderPrototype<T> reloaderPrototype, T defaultValue)
            : base(reloaderPrototype, defaultValue)
        { }

        //=//

        private T InputState;
        public virtual T Input
        {
            get
            {
                return InputState;
            }
            set
            {
                OnPropertyChanging("Input");
                InputState = value;
                OnPropertyChanged("Input");
                Reload();
            }
        }

        protected override T GetValue()
        {
            return Input;
        }
    }
}
